#include "loginwindow.h"
#include "ui_loginwindow.h"

#include "setdblocation.h"
#include "mainwindow.h"

LoginWindow::LoginWindow(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::LoginWindow)
{
    ui->setupUi(this);
}

LoginWindow::~LoginWindow()
{
    delete ui;
}

void LoginWindow::changeEvent(QEvent *e)
{
    QDialog::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

void LoginWindow::on_buttonBox_rejected()
{
    QApplication::exit();
}

void LoginWindow::on_cmdSetDb_clicked()
{
    SetDbLocation sett(this);
    sett.exec();
}

void LoginWindow::on_buttonBox_accepted()
{
    MainWindow *mains = new MainWindow();
    this->setVisible(false);
    mains->showMaximized();
}
